/*
* Copyright (C) 2020 ~ 2024 chaigec All Rights Reserved.
*
* Author:     chaigec <chaigec@163.com>
* Maintainer: chaigec <chaigec@163.com>

 * Use of this source code is governed by MIT license that can be found in the
 * LICENSE file in the root of the source tree. All contributing project authors
 * may be found in the AUTHORS file in the root of the source tree.
*/

#include "MkStateGridB/MkStateGridB.h"
#include<gtest/gtest.h>


typedef MkFunction<void()> RegCallback;
class CMkEventPool;
class CMkTimer;
class CMkStateGridB;
class CMkStateGridBUt : public testing::Test
{
public:
    CMkStateGridBUt();
    ~CMkStateGridBUt();

    void SetUp() override;
    void TearDown() override;

    Uint32 OnServerRequest(const CMkStateGridBRequestBase* pRequest, const MkStateGridBResponseCallback& ResCb);
    Uint32 OnDeviceRequest(const CMkStateGridBRequestBase* pRequest, const MkStateGridBResponseCallback& ResCb);
    Uint32 RegisterServer(CMkStateGridB* pSvr, const MkString& ServerId, Uint32 Expires, const MkMapString& AuthorizationParam, const RegCallback& Cb);
    CMkEventPool*   m_pEventPool;
    CMkTimer*       m_pTimer;


    CMkStateGridB*     m_pServer;
    CMkStateGridB*     m_pDevice;
    void*           m_WaitHandle;

    MkString    m_DeviceId;
    Uint16      m_DevicePort;

    MkString    m_ServerId;
    MkString    m_Realm;
    Uint16      m_ServerPort;
    MkString    m_PlaySession;
    MkString    m_AlaramSubscribeId;
    MkString    m_StatusSubscribeId;
    MkString   m_RegisterId;

};